<template>
  <div id="app">
    <router-view></router-view>
    <footer v-if="!isDetailPage" class="footer">
      <nav>
        <router-link to="/" exact>首页</router-link>
        <router-link to="/seach">找房</router-link>
        <router-link to="/news">资讯</router-link>
        <router-link to="/hello">我的</router-link>
      </nav>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'App',
  computed: {
    isDetailPage() {
      return this.$route.path.startsWith('/detail');
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f8f8f8;
  border-top: 1px solid #e7e7e7;
  text-align: center;
  padding: 10px 0;
  line-height: 40px;
  height: 40px;
}

.footer nav {
  display: flex;
  justify-content: space-around;
}

.footer a {
  text-decoration: none;
  color: #333;
}

.footer a.router-link-active {
  font-weight: bold;
}
</style>